const url = new URL("ftp://admin:1337!@ftp.example.com/");
console.log(url.href); // ftp://admin:1337!@ftp.example.com/
console.log(url.origin); // ftp://ftp.example.com
console.log(url.username); // admin
console.log(url.password); // 1337!
